# build in python 3.5.2
# 作者：陈常鸿
# 两个高斯分布的KL散度
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
fig=plt.figure()
ax=Axes3D(fig)
x=np.linspace(0.1,2,31)
y=np.linspace(-2,2,31)
x,y=np.meshgrid(x,y)
z=-np.log(x)+x*x+y*y/2-0.5
ax.plot_surface(x,y,z,rstride=1,cstride=1,cmap='rainbow')
plt.show()